<template>
	<view>
		<template v-for="(item,index) in titleList" >
			<zy-grid :col="4" :showTip="true" :showTitle="true" :title="item.name" :dataList="dataList[index].dataItem" 
			:key='item.name'></zy-grid>
		</template>
		
		<!-- <zy-grid :col="4" :showTip="true" :showTitle="true" :title="引用验单业务单据"></zy-grid> -->
	</view>
</template>

<script>
	import zyGrid from '../../components/zy-grid/zy-grid.vue'
	export default {
		components:{
			zyGrid
		},
		onLoad(options){
			let PDA_Module_Android = uni.getStorageSync("PDA_Module_Android", "[]"); //获取单据权限
			
			PDA_Module_Android = JSON.parse(PDA_Module_Android);
			
			PDA_Module_Android.forEach((item,index)=>{
				// console.log(this.dataList.dataItem);
				if (item.ModuleName == '采购入库单') {
					if (item.IsCheck == "") {
						this.dataList[0].dataItem[0].isShow = false;
					}
				}if (item.ModuleName == '采购退货单') {
					if (item.IsCheck == "") {
						this.dataList[0].dataItem[1].isShow = false;
					}
				}if (item.ModuleName == '销售出库单') {
					if (item.IsCheck == "") {
						this.dataList[0].dataItem[2].isShow = false;
					}
				}if (item.ModuleName == '销售退货单') {
					if (item.IsCheck == "") {
						this.dataList[0].dataItem[3].isShow = false;
					}
				}if (item.ModuleName == '配送出库单') {
					if (item.IsCheck == "") {
						this.dataList[0].dataItem[4].isShow = false;
					}
				}if (item.ModuleName == '配送退回单') {
					if (item.IsCheck == "") {
						this.dataList[0].dataItem[5].isShow = false;
					}
				}
			});
		},
		data(){
			return {
				titleList:[
					// { name:'业务单据' }
					{ name:'引用验单业务单据' }
				],
				dataList:[
					 { 
						 dataItem: [//格子数据列表
							{
								name: '采购入库单(验)',
								imgUrl: '../../static/zy-grid/grid-01.svg',
								tips: '',
								url: '/pages/validation/validation',
								isShow:true
							},
							{
								name: '采购退货单(验)',
								imgUrl: '../../static/zy-grid/grid-02.svg',
								tips: '',
                                url: '/pages/Purchasereturn/Purchasereturn',
								isShow:true
								
							},
							{
								name: '销售出库单(验)',
								imgUrl: '../../static/zy-grid/grid-03.svg',
								tips: '',
								url:'/pages/salesout/salesout',
								isShow:true
							},
							{
								name: '销售退货单(验)',
								imgUrl: '../../static/zy-grid/grid-04.svg',
								tips: '',
								url:'/pages/salesreturn/salesreturn',
								isShow:true
							},
							{
								name: '配送出库单(验)',
								imgUrl: '../../static/zy-grid/grid-05.svg',
								tips: '',
								url:'/pages/deliveryout/deliveryout',
								isShow:true
							},
							{
								name: '配送退回单(验)',
								imgUrl: '../../static/zy-grid/grid-06.svg',
								tips: '',
								url:'/pages/deliveryreturn/deliveryreturn',
								isShow:true
							}
						]}
				]
				
			}
		}
	}
</script>

<style>
	
</style>
